<template>
  <div>
    <div id="home-input-search" @click="goToSearch">
      <img src="../assets/find.png">
      <span>搜索</span>
    </div>
    <music-list></music-list>
    <recommend-song :count="20"></recommend-song>
  </div>
</template>

<script>
  import RecommendSong from './RecommendSong.vue'
  import MusicList from './MusicList.vue'
  import Loading from './Loading.vue'

  export default {
    name: 'Home',
    components: {
      RecommendSong,
      Loading,
      MusicList
    },
    data() {
      return {
        loading: true
      }
    },
    methods: {
      goToSearch: function () {
        this.$router.push('/search')
      }
    }
  }
</script>
<style>
  #home-input-search {
    width: 100%;
    height: 28px;
    top: 0;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 14px;
    margin: 3px 3px;
  }

  #home-input-search input {
    flex: 6;
    height: 28px;
    background: white;
    outline: none;
    border-radius: 14px;
    border: none;
    padding-left: 20px;
    margin: 5px;
  }

  #home-input-search span {
    font-size: 10px;
    color: gray;
    position: absolute;
    left: 50%;
  }

  #home-input-search img {
    height: 15px;
    width: 15px;
    position: absolute;
    left: 45%;
    border-radius: 10px;
  }
</style>
